<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta charset="utf-8">
  <title></title>
  <meta name="keywords" content="">
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  <link href="css/daterangepicker.min.css" rel="stylesheet">
  <link rel="stylesheet" href="css/main.css">

  <script src="js/vue.js"></script>
  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  <script src="js/request.js"></script>

  <!--[if lt IE 9]>
  <script src="js/html5shiv.min.js"></script>
  <script src="js/respond.min.js"></script>
  <![endif]-->
  <meta name="renderer" content="webkit">
  <link rel="shortcut icon" href="favicon.ico">
  <style rel="stylesheet" type="text/css">
    .max-wid {
      max-width: 240px;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
    }
  </style>
</head>

<body>
<div id="apps">
  <header id="header"></header>
  <div class="header-space"></div>

  <section class="g-main" :style="isShow ? '' : 'display:none;'">
    <div class="content">
      <div class="main-left">

        <div class="js_slideTxtBox g-slideTxtBoxLine">
          <div class="hd">
            <ul>
              <li :class="but === 1 ? 'on' : ''" @click="jumpFun(1)">
                <div class="select-box">
                    <span
                      class="arrow">面试邀请<small>({{interviewTotal1 + interviewTotal2 + interviewTotal3}})</small></span>
                  <div class="select-con">
                    <a style="cursor:pointer;" @click="inviteFun(1)">
                      待处理<small>({{interviewTotal1}})</small></a>
                    <a style="cursor:pointer;" @click="inviteFun(2)">
                      已接受<small>({{interviewTotal2}})</small></a>
                    <a style="cursor:pointer;" @click="inviteFun(3)">
                      已拒绝<small>({{interviewTotal3}})</small></a>
                  </div>
                </div>
              </li>
              <li :class="but === 2 ? 'on' : ''" @click="jumpFun(2)">被查看<small>({{userTotal2}})</small></li>
              <li :class="but === 3 ? 'on' : ''" @click="jumpFun(3)">不合适<small>({{userTotal3}})</small></li>
              <li :class="but === 4 ? 'on' : ''" @click="jumpFun(4)">已投递<small>({{userTotal1}})</small></li>
            </ul>
          </div>
          <div class="bd">
            <!-- 面试邀请 -->
            <div class="con con1" :style="but === 1 ? '' : 'display:none;'">
              <section class="section221">

                <div class="list">
                  <!-- 已拒绝 -->
                  <div class="item" v-for="(list, index) in interviewList3" :key="index" v-if="butOrg === 3" @click="goUrl('08.html?id=' + list.recruit.enterprise_id)">
                    <h3>
                      <a :href="'08.html?id=' + list.recruit.enterprise_id" class="name"><img
                        :src="list.recruit.user && list.recruit.user.log ? list.recruit.user.log : 'images/noUser.png'"
                        alt=""
                        class="face"><b>{{list.recruit.user && list.recruit.user.name ? list.recruit.user.name : ''}}</b><span
                        class="txt"> {{list.recruit.enterprise.name}} | 招聘者</span></a>
                      <span class="status orange max-width">已拒绝：{{list.reason}}</span>
                      <a :href="'08.html?id=' + list.recruit.enterprise_id" class="btn">查看</a>
                    </h3>
                    <div class="detail">
                      <h4>{{list.recruit.name}}
                        <small>{{matchFun(paramList.education || [], list.recruit.education_id, 'id', 'name')}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.nature || [], list.recruit.type, 'id', 'name')}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.experience || [], list.recruit.experience_config_id, 'id', 'min') + '-' + matchFun(paramList.experience || [], list.recruit.experience_config_id, 'id', 'max')}}年&nbsp;&nbsp;|&nbsp;&nbsp;{{addressSearch(paramList.region, list.recruit.area_id)}}</small><span
                          class="money orange">{{list.recruit.salary_min}}-{{list.recruit.salary_max}}K</span></h4>
                      <div class="btm">
                        <div class="l">
                            <span class="tag"
                                  v-for="(item, index) in list.recruit && list.recruit.recruit_welfare ? list.recruit.recruit_welfare : []">{{matchFun(paramList.tag || [], item.welfare_id, 'id', 'name')}}</span>
                        </div>
                        <div class="r">{{list.recruit.enterprise.name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.type || [], list.recruit.enterprise.type_id, 'id', 'name')}}</div>
                      </div>
                    </div>
                  </div>
                  <!-- 待处理 -->
                  <div class="item" v-for="(list, index) in interviewList1" :key="index" v-if="butOrg === 1">
                    <h3>
                      <a class="name"><img
                        :src="list.recruit.user && list.recruit.user.log ? list.recruit.user.log : ''"
                        alt="" class="face"><b>{{list.recruit.user ? list.recruit.user.name : list.recruit.enterprise.name}}</b><span class="txt">&nbsp;&nbsp;|&nbsp;&nbsp;招聘者</span></a>
                      <span class="status blue">向您发送了面试邀请</span>
                      <a style="cursor: pointer;" @click.stop="viewInterFun(list)" class="btn">查看</a>
                    </h3>
                    <div class="detail" @click="goUrl('07.html?id='+list.recruit_id)">
                      <h4>{{list.recruit.name}}
                        <small>{{matchFun(paramList.education || [], list.recruit.education_id, 'id', 'name')}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.nature || [], list.recruit.type, 'id', 'name')}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.experience || [], list.recruit.experience_config_id, 'id', 'min') + '-' + matchFun(paramList.experience || [], list.recruit.experience_config_id, 'id', 'max')}}年&nbsp;&nbsp;|&nbsp;&nbsp;{{addressSearch(paramList.region, list.recruit.area_id)}}</small><span
                          class="money orange">{{list.recruit.salary_min}}-{{list.recruit.salary_max}}K</span></h4>
                      <div class="btm">
                        <div class="l">
                            <span class="tag"
                                  v-for="(item, index) in list.recruit && list.recruit.recruit_welfare ? list.recruit.recruit_welfare : []">{{matchFun(paramList.tag || [], item.welfare_id, 'id', 'name')}}</span>
                        </div>
                        <div class="r">{{list.recruit.enterprise.name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.type || [], list.recruit.enterprise.type_id, 'id', 'name')}}</div>
                      </div>
                    </div>
                  </div>
                  <!-- 已接受 -->
                  <div class="item" v-for="(list, index) in interviewList2" :key="index" v-if="butOrg === 2">
                    <h3>
                      <a class="name"><img
                        :src="list.recruit.user && list.recruit.user.log ? list.recruit.user.log : ''"
                        alt="" class="face"><b>{{list.recruit.user ? list.recruit.user.name : list.recruit.enterprise.name}}</b><span class="txt">&nbsp;&nbsp;|&nbsp;&nbsp;招聘者</span></a>
                      <span class="status blue" v-html="timeFun(list.time)"></span>
                      <a :style="styleFun(list.time) ? 'cursor: pointer;background:#666;' : 'cursor: pointer;'"
                         class="btn" @click="closeInterView(list)">查看</a>
                    </h3>
                    <div class="detail" @click="goUrl('07.html?id='+list.recruit_id)">
                      <h4>{{list.recruit.name}}
                        <small>{{matchFun(paramList.education || [], list.recruit.education_id, 'id', 'name')}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.nature || [], list.recruit.type, 'id', 'name')}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.experience || [], list.recruit.experience_config_id, 'id', 'min') + '-' + matchFun(paramList.experience || [], list.recruit.experience_config_id, 'id', 'max')}}年&nbsp;&nbsp;|&nbsp;&nbsp;{{addressSearch(paramList.region, list.recruit.area_id)}}</small><span
                          class="money orange">{{list.recruit.salary_min}}-{{list.recruit.salary_max}}K</span></h4>
                      <div class="btm">
                        <div class="l">
                            <span class="tag"
                                  v-for="(item, index) in list.recruit && list.recruit.recruit_welfare ? list.recruit.recruit_welfare : []">{{matchFun(paramList.tag || [], item.welfare_id, 'id', 'name')}}</span>
                        </div>
                        <div class="r">{{list.recruit.enterprise.name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.type || [], list.recruit.enterprise.type_id, 'id', 'name')}}</div>
                      </div>
                    </div>
                  </div>

                  <div style="text-align:center;padding-top: 40px;padding-bottom: 20px;" v-if="butOrg === 3 && interviewList3.length === 0 || butOrg === 1 && interviewList1.length === 0 || butOrg === 2 && interviewList2.length === 0">暂无数据</div>

                </div>



                <div class="g-prvNxt">
                  <a style="cursor: pointer;" class="prev" @click="pageJumpInterviewFun('min')">&nbsp;</a>
                  <a style="cursor: pointer;" :class="jumpClass('interviewPage' + butOrg, list)"
                     v-for="list in pageJumpInterviewNumberFun('interviewTotal' + butOrg, 'interviewNum' + butOrg)"
                     :key="list" @click="pageJumpInterviewFun(list)">{{list}}</a>
                  <a style="cursor: pointer;" class="next" @click="pageJumpInterviewFun('max')">&nbsp;</a>
                  <select v-model="interviewNum3" v-if="butOrg === 3">
                    <option value="15">15条/页</option>
                    <option value="20">20条/页</option>
                    <option value="30">30条/页</option>
                    <option value="40">40条/页</option>
                    <option value="50">50条/页</option>
                  </select>
                  <select v-model="interviewNum2" v-if="butOrg === 2">
                    <option value="15">15条/页</option>
                    <option value="20">20条/页</option>
                    <option value="30">30条/页</option>
                    <option value="40">40条/页</option>
                    <option value="50">50条/页</option>
                  </select>
                  <select v-model="interviewNum1" v-if="butOrg === 1">
                    <option value="15">15条/页</option>
                    <option value="20">20条/页</option>
                    <option value="30">30条/页</option>
                    <option value="40">40条/页</option>
                    <option value="50">50条/页</option>
                  </select>
                  跳至
                  <input type="text" v-model="jumpNum" class="input">
                  页
                  <input type="submit" value="确定" class="btn" @click="goJumpInterviewNum(jumpNum)">
                </div>

              </section>
            </div>
            <!-- /面试邀请 -->
            <!-- 被查看 -->
            <div class="con con2" :style="but === 2 ? '' : 'display:none;'">
              <section class="section222">
                <div class="list">

                  <div class="item" v-for="(list, index) in userList2" :key="index" @click="goUrl('08.html?id=' + list.recruit.enterprise_id)">
                    <div class="face"><a><img :src="list.recruit.enterprise.logo || 'images/noUser.png'" alt=""></a>
                    </div>
                    <div class="con">
                      <h3><a><b>{{list.recruit.enterprise.name}}</b></a></h3>
                      <p>{{list.recruit.enterprise.address}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.type || [], list.recruit.enterprise.type_id, 'id', 'name')}}</p>
                      <p>招聘信息{{list.recruit.enterprise.recruit_count}}条</p>
                    </div>
                    <div class="con con2">
                      <p><time>{{timeFun(list.updated_at)}}</time></p>
                    </div>
                    <a :href="'08.html?id=' + list.recruit.enterprise_id" class="btn">查看</a>
                  </div>

                  <div style="text-align:center;padding-top: 40px;padding-bottom: 20px;" v-if="userList2.length === 0">暂无数据</div>

                </div>


                <div class="g-prvNxt">
                  <a style="cursor: pointer;" class="prev" @click="pageJumpUserFun('min')">&nbsp;</a>
                  <a style="cursor: pointer;" :class="userPage2 == list ? 'on' : ''"
                     v-for="list in pageJumpInterviewNumberFun('userTotal2', 'userNum2')" :key="list"
                     @click="pageJumpUserFun(list)">{{list}}</a>
                  <a style="cursor: pointer;" class="next" @click="pageJumpUserFun('max')">&nbsp;</a>
                  <select v-model="userNum2">
                    <option value="15">15条/页</option>
                    <option value="20">20条/页</option>
                    <option value="30">30条/页</option>
                    <option value="40">40条/页</option>
                    <option value="50">50条/页</option>
                  </select>
                  跳至
                  <input type="text" v-model="userPages2" class="input">
                  页
                  <input type="submit" value="确定" @click="goJumpUserNum(userPages2, 2)" class="btn">
                </div>

              </section>
            </div>
            <!-- /被查看 -->
            <!-- 不合适 -->
            <div class="con con3" :style="but === 3 ? '' : 'display:none;'">
              <section class="section221">
                <div class="list">


                  <div class="item" v-for="(list, index) in userList3" :key="index">
                    <div class="title">
                      <b>企业回复： </b>{{list.reason}}
                    </div>
                    <div class="detail" @click="goUrl('07.html?id=' + list.recruit_id)">
                      <h4>{{list.recruit.name}}
                        <small>{{matchFun(paramList.education || [], list.recruit.education_id, 'id', 'name')}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.nature || [], list.recruit.type, 'id', 'name')}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.experience || [], list.recruit.experience_config_id, 'id', 'min') + '-' + matchFun(paramList.experience || [], list.recruit.experience_config_id, 'id', 'max')}}年&nbsp;&nbsp;|&nbsp;&nbsp;{{addressSearch(paramList.region, list.recruit.area_id)}}</small><span
                          class="money">{{list.recruit.salary_min}}-{{list.recruit.salary_max}}K</span></h4>
                      <div class="btm">
                        <div class="l">
                            <span class="tag"
                                  v-for="(item, index) in list.recruit && list.recruit.recruit_welfare ? list.recruit.recruit_welfare : []">{{matchFun(paramList.tag || [], item.welfare_id, 'id', 'name')}}</span>
                        </div>
                        <div class="r">
                          {{list.recruit && list.recruit.enterprise && list.recruit.enterprise.name ? list.recruit.enterprise.name : ''}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.type || [], list.recruit.enterprise.type_id, 'id', 'name')}}</div>
                      </div>
                    </div>
                  </div>

                  <div style="text-align:center;padding-top: 40px;padding-bottom: 20px;" v-if="userList3.length === 0">暂无数据</div>

                </div>



                <div class="g-prvNxt">
                  <a style="cursor: pointer;" class="prev" @click="pageJumpUserFun('min')">&nbsp;</a>
                  <a style="cursor: pointer;" :class="userPage3 == list ? 'on' : ''"
                     v-for="list in pageJumpInterviewNumberFun('userTotal3', 'userNum3')" :key="list"
                     @click="pageJumpUserFun(list)">{{list}}</a>
                  <a style="cursor: pointer;" class="next" @click="pageJumpUserFun('max')">&nbsp;</a>

                  <select v-model="userNum3">
                    <option value="15">15条/页</option>
                    <option value="20">20条/页</option>
                    <option value="30">30条/页</option>
                    <option value="40">40条/页</option>
                    <option value="50">50条/页</option>
                  </select>
                  跳至
                  <input type="text" v-model="userPages3" class="input">
                  页
                  <input type="submit" value="确定" @click="goJumpUserNum(userPages3, 3)" class="btn">
                </div>

              </section>
            </div>
            <!-- /不合适 -->
            <!-- 已投递 -->
            <div class="con con4" :style="but === 4 ? '' : 'display:none;'">
              <section class="section224">
                <div class="list">

                  <div class="item" v-for="(list, index) in userList1" :key="index" @click="goUrl('07.html?id=' + list.recruit.id)">
                    <div class="con">
                      <h3><a><b>{{list.recruit.name}}</b></a> <span
                        class="orange e2">{{list.recruit.salary_min}}-{{list.recruit.salary_max}}K</span></h3>
                      <p>{{matchFun(paramList.education || [], list.recruit.education_id, 'id', 'name')}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.nature || [], list.recruit.type, 'id', 'name')}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.experience || [], list.recruit.experience_config_id, 'id', 'min') + '-' + matchFun(paramList.experience || [], list.recruit.experience_config_id, 'id', 'max')}}年
                      </p>
                      <p>
                          <span class="tag"
                                v-for="(item, index) in list.recruit && list.recruit.recruit_welfare ? list.recruit.recruit_welfare : []">{{matchFun(paramList.tag || [], item.welfare_id, 'id', 'name')}}</span>
                      </p>
                    </div>
                    <div class="con max-wid">
                      <h3><a>{{list.recruit.enterprise.name}}</a></h3>
                      <p>{{addressSearch(paramList.region, list.recruit.area_id)}}&nbsp;&nbsp;|&nbsp;&nbsp;{{matchFun(paramList.type || [], list.recruit.enterprise.type_id, 'id', 'name')}}</p>
                      <p><time>{{timeFun(list.updated_at)}}</time></p>
                    </div>
                    <a :href="'07.html?id=' + list.recruit.id" class="btn">查看</a>
                  </div>
                  <div style="text-align:center;padding-top: 40px;padding-bottom: 20px;" v-if="userList1.length === 0">暂无数据</div>

                </div>
                <div class="g-prvNxt">
                  <a style="cursor: pointer;" class="prev" @click="pageJumpUserFun('min')">&nbsp;</a>
                  <a style="cursor: pointer;" :class="userPage1 == list ? 'on' : ''"
                     v-for="list in pageJumpInterviewNumberFun('userTotal1', 'userNum1')" :key="list"
                     @click="pageJumpUserFun(list)">{{list}}</a>
                  <a style="cursor: pointer;" class="next" @click="pageJumpUserFun('max')">&nbsp;</a>

                  <select v-model="userNum1">
                    <option value="15">15条/页</option>
                    <option value="20">20条/页</option>
                    <option value="30">30条/页</option>
                    <option value="40">40条/页</option>
                    <option value="50">50条/页</option>
                  </select>
                  跳至
                  <input type="text" v-model="userPages1" class="input">
                  页
                  <input type="submit" value="确定" @click="goJumpUserNum(userPages1, 1)" class="btn">
                </div>
              </section>
            </div>
            <!-- /已投递 -->
          </div>
        </div>



      </div>
      <div class="main-right">


        <div class="g-user">
          <a href="21.html" class="btn-edit">编辑</a>
          <img :src="userInfo && userInfo.image ? userInfo.image : 'images/noUser.png'" alt="" class="face">
          <h3>{{userInfo && userInfo.name ? userInfo.name : ''}}</h3>
          <div class="txt">{{userInfo.experience}}</div>
          <div class="info">
            <div class="item">
              <h4>{{userInfo && userInfo.invite}}</h4>
              <p>面试邀请</p>
            </div>
            <div class="item">
              <h4>{{userInfo && userInfo.watch}}</h4>
              <p>被查看</p>
            </div>
            <div class="item">
              <h4>{{userInfo && userInfo.out}}</h4>
              <p>不合适</p>
            </div>
            <div class="item">
              <h4>{{userInfo && userInfo.send}}</h4>
              <p>已投递</p>
            </div>
          </div>
        </div>
        <div class="g-sideInfo">
          <h3>简历类型</h3>
          <div class="hd">
            <a style="cursor: pointer;"
               :class="userInfo && userInfo.type && userInfo.type.language === 0 ? 'on' : ''" @click="userInfo.type.language = 0">中文版</a>
            <a style="cursor: pointer;"
               :class="userInfo && userInfo.type && userInfo.type.language === 1 ? 'on' : ''" @click="userInfo.type.language = 1">英文版</a>
          </div>
          <h3>隐私设置 <a style="cursor: pointer;" class="blue"
                      @click="upHidde(userInfo.type.hidden === 0 ? 1 : 0)">{{userInfo.type && userInfo.type && userInfo.type.hidden === 0 ? '隐藏简历' : '显示简历'}}</a>
          </h3>
          <div class="con">
            <div class="item" style="position:relative;">
              简历设置 <span
              style="position:absolute;right: 0;">{{userInfo.type && userInfo.type && userInfo.type.hidden === 0 ? '已显示' : '已隐藏'}}</span>
              <!-- <text style="position:absolute;right: 0;">已隐藏</text>-->
            </div>
          </div>
        </div>


      </div>
    </div>
  </section>

  <div class="alert alert-accept" :class="interviewAccepted ? 'show' : ''" v-if="interviewAccepted">
    <div class="over-close" @click="closeView"></div>
    <div class="box">
      <div class="user">
        <img :src="viewDate.recruit.user && viewDate.recruit.user.logo ? viewDate.recruit.user.logo : 'images/noUser.png'" alt="" class="face">
        <h4>{{viewDate.recruit.user ? viewDate.recruit.user.name : ''}}</h4>
        <p>{{viewDate.recruit.enterprise.name}} | 招聘者</p>
      </div>
      <div class="info">
        <div class="item"><span class="tt">联系人：</span>{{viewDate.name}}</div>
        <div class="item"><span class="tt">联系电话：</span>{{viewDate.tel}}</div>
        <div class="item"><span
          class="tt">面试岗位：</span><!--{{matchPositionFun(paramList.position || [], viewDate.recruit_id)}}-->{{viewDate.recruit.name}}</div>
        <div class="item"><span class="tt">面试时间：</span>{{viewDate.time}}</div>
        <div class="item"><span class="tt">面试地址：</span>{{viewDate.address}}</div>
        <div class="item"><span class="tt">备注：</span>{{viewDate.remark}}</div>
        <div class="item tips">面试前 6 小时您可以取消面试！</div>
      </div>
      <div class="operate" v-if="butOrg === 1">
        <a style="cursor: pointer;" @click="refuseFun(viewDate, 3)" class="btn btn-white">拒绝</a><a
        style="cursor: pointer;" @click="acceptFun(viewDate)" class="btn">接受</a>
      </div>
      <div class="operate" v-if="butOrg === 2 && !styleFun(viewDate.time)">
        <a style="cursor: pointer;" @click="refuseFun(viewDate, 4)" class="btn btn-white w100 js_btn-cancle">取消面试</a>
      </div>
    </div>
  </div>

  <footer>
    <div class="content">
      <div class="menu">
        <a href="20.html">联系我们</a>
        <a href="23.html">意见反馈</a>
        <a href="24.html">关于我们</a>
      </div>
      <div class="cpt">
        Copyright &#169 2019 人员招聘 ICP备14013400号-1京ICP证150920号 电子营业执照 <a href="">京公网安备11010502031234</a> 首都网警 <a
        href="">人力资源服务许可证</a>
      </div>
    </div>
  </footer>
</div>
<script src="js/lcommon.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/slide.min.js"></script>
<script src="js/polyfill.min.js"></script>
<script src="js/jquery.nicescroll3.7.6.min.js"></script>
<style rel="stylesheet" type="text/css">
  .max-width {
    max-width: 300px;
    display: inline-block;
    flex-wrap: wrap;
    overflow: hidden;
    vertical-align: middle;
  }
</style>
<!--<script src="js/main.js"></script>-->
<script>
  $(function () {
    $("header .menu li").eq(0).addClass('on');
    $("#header").load("./lcommon/header.html");
  })

  var vm = new Vue({
    el: '#apps',
    data() {
      return {
        /** 弹窗控制 **/
        interviewAccepted: false,

        isShow: false,

        but: 1, // 1面试邀请 2 被查看 3 不适合 4 已投递
        butOrg: 1, // 1为待处理 2为已接受 3为已拒绝
        jumpNum: '', // 跳至第几页

        /** 面试邀请 **/
        interviewList1: [], // 面试邀请 待处理
        interviewList2: [], // 面试邀请 已接受
        interviewList3: [], // 面试邀请 已拒绝
        interviewTotal1: 0,
        interviewTotal2: 0,
        interviewTotal3: 0,
        interviewPage1: 1,
        interviewPage2: 1,
        interviewPage3: 1,
        interviewNum1: 15,
        interviewNum2: 15,
        interviewNum3: 15,

        /** 被查看 **/
        userList2: [],
        userTotal2: 0,
        userNum2: 15,
        userPage2: 1,
        userPages2: '',

        /** 不适合 **/
        userList3: [],
        userTotal3: 0,
        userNum3: 15,
        userPage3: 1,
        userPages3: '',

        /** 已投递 **/
        userList1: [],
        userTotal1: 0,
        userNum1: 15,
        userPage1: 1,
        userPages1: '',

        userInfo: {},

        /** 基础数据查询 **/
        paramList: null,

        /** 弹窗数据 **/
        viewDate: null,
      }
    },
    created() {
      this.getBasis();
    },
    mounted() {
      this.isShow = true;
    },
    methods: {
      addressSearch(list, val) {
        for (let i = 0; i < list.length; i++) {
          if (Number(list[i].id) === Number(val)) {
            return list[i].region_name;
          } else if (list[i].children && list[i].children.length > 0) {
            let str = this.addressSearch(list[i].children, val);
            if (str) return list[i].region_name + '-' + str;
          }
        }
        return '';
      },
      upHidde(val) {
        let url = 'person/resume/hidden';
        request(url, 'PUT', JSON.stringify({
          hidden: val
        }), res => {
          if (res.code === 1) {
            this.userInfo.type.hidden = val;
          }
        }, err => {
          console.log(err)
        })
      },
      // 取消面试弹窗
      closeInterView(list) {
        console.log('查看', list)
        // if (this.styleFun(list.time)) return false;
        this.viewDate = list;
        this.interviewAccepted = true;
      },
      styleFun(time) {
        let thisTime = new Date().getTime();
        let times = new Date(time).getTime();
        return thisTime > times;
      },
      // 拒绝
      refuseFun(list, type) {
        let param = {
          type: type,
          reason: ''
        };
        this.$prompt('请输入拒绝理由', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
        }).then(({
                   value
                 }) => {
          param.reason = value;
          this.upStatus(list.id, param);
        }).catch(() => {
          this.upStatus(list.id, param);
        });
      },
      // 接受
      acceptFun(list) {
        let param = {
          type: 2
        };
        this.upStatus(list.id, param);
      },
      // 请求
      upStatus(id, param) {
        let url = 'person/my/interview';
        if (id) url = url + '/' + id;
        // param.id = id;
        request(url, 'PUT', JSON.stringify(param), res => {
          console.log(res);
          if (res.code === 1) {
            // 更新信息
            this.closeView();
            this['interviewPage' + this.butOrg] = 1;
            this.getList(this.butOrg, 1);
          }
        }, err => {
          console.log(err)
        })
      },
      closeView() {
        this.interviewAccepted = false;
        this.viewDate = null;
      },
      viewInterFun(list) {
        console.log('开始', list)
        this.viewDate = list;
        this.interviewAccepted = true;
      },
      goUrl(url) {
        window.location.href = url;
      },
      jumpClass(name, val) {
        if (this[name] == val) return 'on';
      },
      timeFun(val) {
        var timestamp = new Date(val).getTime();

        var minute = 1000 * 60;
        var hour = minute * 60;
        var day = hour * 24;
        var halfamonth = day * 15;
        var month = day * 30;
        var year = day * 365;
        var now = new Date().getTime();
        var diffValue = now - timestamp;
        var result;
        if (diffValue < 0) {
          return;
        }
        var yearC = diffValue / year;
        var monthC = diffValue / month;
        var weekC = diffValue / (7 * day);
        var dayC = diffValue / day;
        var hourC = diffValue / hour;
        var minC = diffValue / minute;
        if (yearC >= 1) {
          result = "" + parseInt(yearC) + "年前";
        } else if (monthC >= 1) {
          result = "" + parseInt(monthC) + "月前";
        } else if (weekC >= 1) {
          result = "" + parseInt(weekC) + "周前";
        } else if (dayC >= 1) {
          result = "" + parseInt(dayC) + "天前";
        } else if (hourC >= 1) {
          result = "" + parseInt(hourC) + "小时前";
        } else if (minC >= 1) {
          result = "" + parseInt(minC) + "分钟前";
        } else
          result = "刚刚";
        return result;
      },
      // 计算页数
      pageJumpInterviewNumberFun(num, page) {
        try {
          return Math.ceil(this[num] / this[page]);
        } catch (e) {
          return 0;
        }
      },
      // 跳至
      goJumpInterviewNum(val) {
        let name = 'interviewPage' + this.butOrg;
        this[name] = val;
        this.getList(this.butOrg, this[name]);
      },
      goJumpUserNum(val, id) {
        let name = 'userPage' + id;
        this[name] = val;
        this.getStatus(id, val);
      },
      // 页数加减 or 跳页
      pageJumpInterviewFun(page) {
        let name = 'interviewPage' + this.butOrg;
        if (page === 'min') {
          if (this[name] !== 1) {
            this[name] -= 1;
            this.getList(this.butOrg, this[name]);
          }
        } else if (page === 'max') {
          if (this[name] * this['interviewNum' + this.butOrg] < this['interviewTotal' + this.butOrg]) {
            this[name] += 1;
            this.getList(this.butOrg, this[name]);
          }
        } else {
          this[name] = page;
          this.getList(this.butOrg, this[name]);
        }
      },
      pageJumpUserFun(page) {
        let name = 'userPage' + this.but;
        if (page === 'min') {
          if (this[name] !== 1) {
            this[name] -= 1;
            this.getStatus(this.but === 4 ? 1 : this.but, this[name]);
          }
        } else if (page === 'max') {
          if (this[name] * this['userNum' + this.but] < this['userTotal' + this.but]) {
            this[name] += 1;
            this.getStatus(this.but === 4 ? 1 : this.but, this[name]);
          }
        } else {
          this[name] = page;
          this.getStatus(this.but === 4 ? 1 : this.but, this[name]);
        }
      },
      jumpFun(val) {
        this.but = val;
      },
      inviteFun(id) {
        this.butOrg = id;
        // this.getList(id);
      },
      // 岗位id 专属查询
      matchPositionFun(list, id) {
        console.log('岗位查询', list, id)
        for (let i = 0; i < list.length; i++) {
          if (list[i].id === id) {
            console.log('找到了')
            return list[i].name;
          } else if (list[i].children && list[i].children.length > 0) {
            let str = this.matchPositionFun(list[i].children, id);
            if (str) return str;
          }
        }
        return '';
      },
      // 地址查询
      matchAddressFun(list, val) {
        if (!Array.isArray(list)) return '';
        let strs = '';
        for (let i = 0; i < list.length; i++) {
          if (list[i].id === val) {
            return list[i].name;
          } else if (list[i].id < val && list[i + 1] && list[i + 1].id > val || i === (list.length - 1)) {
            strs = list[i].name;
            if (list[i].second && list[i].second.length > 0) {
              let secondList = list[i].second;
              for (let s = 0; s < secondList.length; s++) {
                if (secondList[s].id === val) {
                  return strs + '-' + secondList[s].name;
                } else if (secondList[s].id < val && secondList[s + 1] && secondList[s + 1].id > val || s === (
                  secondList.length - 1)) {
                  let thirdList = secondList[s].third;
                  for (let t = 0; t < thirdList.length; t++) {
                    if (thirdList[t].id === val) {
                      return strs + '-' + thirdList[t].name;
                    }
                  }
                }
              }
            }
          }
        }
        return strs;
      },
      // 匹配方法 list 需要匹配的列表 val 匹配的值 item 匹配的字段
      matchFun(list, val, item, name) {
        if (!list || list.length === 0) return '';
        for (let i = 0; i < list.length; i++) {
          if (item) {
            if (list[i][item] == val) {
              return list[i][name];
            }
          } else {}
        }
      },
      // 查询全部(初始走的)
      getAll() {
        this.getList(1, 1);
        this.getList(2, 1);
        this.getList(3, 1);
        this.getStatus(2, 1);
        this.getStatus(3, 1);
        this.getStatus(1, 1);
      },
      // 面试邀请
      getList(id, page) {
        let url = 'person/my/interview';
        if (id || id === 0) {
          url = url + '/' + id;
        }
        request(url, 'GET', {
          page: page ? page : 1
        }, res => {
          console.log('面试邀请请求', id, res);
          if (res.code === 1) {
            this['interviewList' + id] = res.data.list;
            this['interviewTotal' + id] = res.data.total;
          }
        }, err => {
          console.log('错误', err)
        })
      },
      // 1为已投递 2为已查看 3为不合适 4为已录用 5为已邀请面试
      getStatus(id, page) {
        let url = 'person/my/user_recruit';
        if (id || id === 0) {
          url = url + '/' + id;
        }
        request(url, 'GET', {
          page: page
        }, res => {
          console.log('投递信息', id, res);
          if (res.code === 1) {
            this['userList' + id] = res.data.list;
            this['userTotal' + id] = res.data.total;
          }
        }, err => {
          console.log('错误1', err)
        })
      },
      getUserInfo() {
        if (!this.getToken()) return;
        let url = 'person/my/info';
        request(url, 'GET', '', res => {
          console.log(res);
          if (res.code === 1) {
            this.userInfo = res.data.info;
          }
        }, error => {
          console.log('error')
        })
      },
      getToken() {
        return sessionStorage.getItem("token") || null;
      },
      // 查询基础数据
      getBasis() {
        let url = 'person/index/prepare';
        request(url, 'GET', '', res => {
          console.log('查询结果', res);;
          if (res.code === 1) {
            this.paramList = res.data;
            this.getAll();
            this.getUserInfo();
          }
        }, function (err) {
          console.log('错误', err)
        })
      },
    }
  })
</script>
</body>

</html>
